//
//  qiyexinxitwoViewController.m
//  BAOASystem
//
//  Created by michael on 2018/6/4.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "qiyexinxitwoViewController.h"
#import "qyxxoneViewController.h"
#import "OALoginViewController.h"
#import <CommonCrypto/CommonDigest.h>
#import "qiyexinxitwoViewController.h"
#import "threelevelViewController.h"
#import "qiyezuceViewController.h"
@interface qiyexinxitwoViewController ()

@end

@implementation qiyexinxitwoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
          NSArray *views = [[NSBundle mainBundle] loadNibNamed:@"LZPickerView" owner:nil options:nil];
    self.lzPickerVIew  = views[0];
    self.view.backgroundColor = [UIColor whiteColor];
     NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:

[UIColor whiteColor],NSForegroundColorAttributeName, nil];
 
[self.navigationController.navigationBar setTitleTextAttributes:attributes];
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"0a62ea"];
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
          self.navigationController.navigationBar.hidden = NO;

        self.title = NSLocalizedString(@"修改", nil);
        [self loaddata];
 
      UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"返回"]style:UIBarButtonItemStylePlain target:self action:@selector(buttonClick)];
 self.navigationItem.leftBarButtonItem = item1;
    // Do any additional setup after loading the view.
}
- (void)loaddata{
 [MBProgressHUD showHUDAddedTo:self.view animated:YES];

NSString *website = [[NSUserDefaults standardUserDefaults] objectForKey:@"website"];
NSString *userName = [[NSUserDefaults standardUserDefaults] objectForKey:@"userName"];
NSString *password = [[NSUserDefaults standardUserDefaults] objectForKey:@"password"];

   NSString *language = [[NSUserDefaults standardUserDefaults] objectForKey:@"language"];
   NSString *uid = [[NSUserDefaults standardUserDefaults] objectForKey:@"uid"];
   NSString *bodyStr = [NSString stringWithFormat:@"<?xml version='1.0' encoding='UTF-8'?><message><header><userName>%@</userName><password>%@</password><website>%@</website><language>%@</language><type>%@</type></header><body><uid>%@</uid></body></message>",userName,password,website,language,BAtype,uid];
 bodyStr= [bodyStr URLEncodedString];
 NSArray * array = @[@{@"arg0":bodyStr}];
     NSString * path = [NSString stringWithFormat:@"%@%@",BAip,bRegister];
 [HttpTools requestWithURL:path arrays:array method:@"toCompanyEdit" success:^(id JSON) {
    [MBProgressHUD hideHUDForView:self.view animated:YES];
   NSLog(@"%@",JSON);
   if ([[NSString stringWithFormat:@"%@",JSON[@"code"]]isEqualToString:@"200"]){
   
   _dic = JSON;
   _dict = JSON[@"CompanyInfo"];
   _registeredNo = _dict[@"registeredNo"];
      _name = _dict[@"name"];
      _phonenumber = _dict[@"mobile"];
      _fax = _dict[@"fax"];
      _applyDepartmentName = _dict[@"applyDepartmentName"];
      _applyPostName = _dict[@"applyPostName"];
      _shengname =_dic[@"selSheng"][@"areaname"];
      _shengid =_dic[@"selSheng"][@"id"];
      _countryname =_dic[@"selGj"][@"areaname"];
_countryid =_dic[@"selGj"][@"id"];
_shiname =_dic[@"selShi"][@"areaname"];
_shiid =_dic[@"selShi"][@"id"];
_quname =_dic[@"selQx"][@"areaname"];
_quid =_dic[@"selQx"][@"id"];
      _address = _dict[@"address"];
      _zipCode = _dict[@"zipCode"];
      _registeredCapital = _dict[@"registeredCapital"];
_organizationname =_dic[@"selOrg"][@"orgname"];
_organizationid =_dic[@"selOrg"][@"id"];
_countUnitListid = _dict[@"countUnit"];
_monetaryUnitid = _dict[@"monetaryUnit"];
_countUnitListname = _dict[@"selCountUnit"];
_monetaryUnitname = _dict[@"selMtyUnit"];
_setuptime =_dict[@"registerDate"];
_starttime =_dict[@"startDate"];
_endtime =_dict[@"endDate"];
_cptypename =_dict[@"selCptype"];
_cptypeid =_dict[@"type"];
_lagalPerson =_dict[@"lagalPerson"];
_dengji =_dict[@"registrationAuth"];
_businessScope =_dict[@"businessScope"];
_businessScope =_dict[@"businessScope"];
_selCategoryName =_dic[@"selCategoryName"];
_leimuid =_dic[@"selCptype"][@"id"];

_website =_dict[@"websites"];
_logo =_dict[@"Brand"];
_remark =_dict[@"description"];

     if((![_dict isEqual:[NSNull null]])&&(![httpTool isBlankString: _dict[@"id"]])){
    _qiyeid = _dict[@"id"];
     }
NSDictionary *dictionary = JSON;
NSMutableArray *muamoney = [NSMutableArray array];
for (NSDictionary *dic in dictionary[@"monetaryUnitList"]) {
    [muamoney addObject:dic[@"dictname"]];
}
_monetaryUnitList = muamoney;
_areaList = dictionary[@"areaList"];
NSMutableArray *muaarea = [NSMutableArray array];
for (NSDictionary *dic in dictionary[@"areaList"]) {
    [muaarea addObject:dic[@"areaname"]];
}
_countryList =muaarea;
NSMutableArray *muacptype = [NSMutableArray array];
for (NSDictionary *dic in dictionary[@"cptypeList"]) {
    [muacptype addObject:dic[@"dictname"]];
}
_cptypeList = muacptype;

NSMutableArray *muacountUnit = [NSMutableArray array];
for (NSDictionary *dic in dictionary[@"countUnitList"]) {
    [muacountUnit addObject:dic[@"dictname"]];
}
_countUnitList = muacountUnit;

NSMutableArray *muaorgan = [NSMutableArray array];
for (NSDictionary *dic in dictionary[@"organizationList"]) {
    [muaorgan addObject:dic[@"orgname"]];
}
_organizationList = muaorgan;
[self initview];
 }else{
    [self.view makeToast:JSON[@"msg"]];
}
 } failure:^(NSError *error) {
  [MBProgressHUD hideHUDForView:self.view animated:YES];

    }];

}
- (void)buttonClick2{
qiyexinxitwoViewController *vc = [[qiyexinxitwoViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];

}
//- (void)loaddata{
// [MBProgressHUD showHUDAddedTo:self.view animated:YES];
//
// NSMutableDictionary *dics=[NSMutableDictionary dictionary];
//      dics[@"userName"] = @"administrator";
//    dics[@"password"] = @"b628e2c3b78ef9bf269c489b35176e48";
//
//    dics[@"language"] = [[NSUserDefaults standardUserDefaults] objectForKey:@"language"];
//     dics[@"website"] = [[NSUserDefaults standardUserDefaults] objectForKey:@"website"];
//        dics[@"type"] = BAtype;
//         NSString *dicstring = [httpTool dictionaryToJson:dics];
//dicstring= [dicstring URLEncodedString];
//NSString *url = [[NSString alloc]initWithFormat:@"%@/api/commonApi/registCommonList?data=%@",BAip,dicstring];
// [httpTool ZBPostNetDataWith:url withDic:nil andSuccess:^(NSDictionary* dictionary){
//    [MBProgressHUD hideAllHUDsForView:self.view animated:YES];
//      _dic = dictionary;
//if ([[NSString stringWithFormat:@"%@",dictionary[@"code"]]isEqualToString:@"200"]) {
//NSMutableArray *muamoney = [NSMutableArray array];
//for (NSDictionary *dic in dictionary[@"monetaryUnitList"]) {
//    [muamoney addObject:dic[@"dictname"]];
//}
//_monetaryUnitList = muamoney;
//_areaList = dictionary[@"areaList"];
//NSMutableArray *muaarea = [NSMutableArray array];
//for (NSDictionary *dic in dictionary[@"areaList"]) {
//    [muaarea addObject:dic[@"areaname"]];
//}
//_countryList =muaarea;
//NSMutableArray *muacptype = [NSMutableArray array];
//for (NSDictionary *dic in dictionary[@"cptypeList"]) {
//    [muacptype addObject:dic[@"dictname"]];
//}
//_cptypeList = muacptype;
//
//NSMutableArray *muacountUnit = [NSMutableArray array];
//for (NSDictionary *dic in dictionary[@"countUnitList"]) {
//    [muacountUnit addObject:dic[@"dictname"]];
//}
//_countUnitList = muacountUnit;
//
//NSMutableArray *muaorgan = [NSMutableArray array];
//for (NSDictionary *dic in dictionary[@"organizationList"]) {
//    [muaorgan addObject:dic[@"orgname"]];
//}
//_organizationList = muaorgan;
//
//[self initview];
//
//}else{
//    [self.view makeToast:dictionary[@"msg"]];
//}
//
//   NSLog(@"%@",dictionary);
//
//            [self.tableView headerEndRefreshing];
//
// }andFailure:^{
//    [MBProgressHUD hideAllHUDsForView:self.view animated:YES];
//
//
// }];
//
//
//
//}

- (void)initview{
if(!_tableView){
 _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth,KScreenHeight-kTopHeight) style:UITableViewStylePlain];
        self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.bounces = NO;
_tableView.dataSource = self;
_tableView.delegate = self;
[self.view addSubview:_tableView];
}
}
- (void)buttonClick{
[self.navigationController popViewControllerAnimated:YES];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 26+1;
}
- (void)idendediting{

NSString *idstring=[_tongyifield.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (idstring.length>0) {
    [MBProgressHUD showHUDAddedTo:self.view animated:YES];

 NSMutableDictionary *dics=[NSMutableDictionary dictionary];
    dics[@"userName"] = @"administrator";
    dics[@"password"] = @"b628e2c3b78ef9bf269c489b35176e48";
    
    dics[@"language"] = [[NSUserDefaults standardUserDefaults] objectForKey:@"language"];
     dics[@"website"] = [[NSUserDefaults standardUserDefaults] objectForKey:@"website"];
     dics[@"type"] = BAtype;
     dics[@"regcode"] = idstring;
         NSString *dicstring = [httpTool dictionaryToJson:dics];
dicstring= [dicstring URLEncodedString];
NSString *url = [[NSString alloc]initWithFormat:@"%@/api/commonApi/getCompanyByEnInfo?data=%@",BAip,dicstring];
 [httpTool ZBPostNetDataWith:url withDic:nil andSuccess:^(NSDictionary* dictionary){
    [MBProgressHUD hideAllHUDsForView:self.view animated:YES];
     NSLog(@"%@",dictionary);
      if ([[NSString stringWithFormat:@"%@",dictionary[@"code"]]isEqualToString:@"200"]) {
      _dic = dictionary;
    _dict = dictionary[@"etinfo"];

   _registeredNo = _dict[@"registeredNo"];
      _name = _dict[@"name"];
      _phonenumber = _dict[@"mobile"];
      _fax = _dict[@"fax"];
      _applyDepartmentName = _dict[@"applyDepartmentName"];
      _applyPostName = _dict[@"applyPostName"];
      _shengname =_dic[@"selSheng"][@"areaname"];
      _shengid =_dic[@"selSheng"][@"id"];
      _countryname =_dic[@"selGj"][@"areaname"];
_countryid =_dic[@"selGj"][@"id"];
_shiname =_dic[@"selShi"][@"areaname"];
_shiid =_dic[@"selShi"][@"id"];
_quname =_dic[@"selQx"][@"areaname"];
_quid =_dic[@"selQx"][@"id"];
      _address = _dict[@"address"];
      _zipCode = _dict[@"zipCode"];
      _registeredCapital = _dict[@"registeredCapital"];
_organizationname =_dic[@"selOrg"][@"orgname"];
_organizationid =_dic[@"selOrg"][@"id"];
_countUnitListid = _dict[@"countUnit"];
_monetaryUnitid = _dict[@"monetaryUnit"];
_countUnitListname = _dict[@"selCountUnit"];
_monetaryUnitname = _dict[@"selMtyUnit"];
_setuptime =_dict[@"registerDate"];
_starttime =_dict[@"startDate"];
_endtime =_dict[@"endDate"];
_cptypename =_dict[@"selCptype"];
_cptypeid =_dict[@"type"];
_lagalPerson =_dict[@"lagalPerson"];
_dengji =_dict[@"registrationAuth"];
_businessScope =_dict[@"businessScope"];
_selCategoryName =_dict[@"selCategoryName"];
_leimuid =_dic[@"selCptype"][@"id"];

_website =_dict[@"websites"];
_logo =_dict[@"Brand"];
_remark =_dict[@"description"];

    [_tableView reloadData];

}else{
    _dict = [NSDictionary dictionary];

[self.view makeToast:dictionary[@"msg"]];
}
    
    }andFailure:^{
    [MBProgressHUD hideAllHUDsForView:self.view animated:YES];


 }];
}
}
//- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
//
//            return NO;
//
//}
//- (BOOL)textViewShouldBeginEditing:(UITextView *)textView {
//
//            return NO;
//
//}
- (void)textFieldDidEndEditing:(UITextField *)textField{
if (textField ==_tongyifield) {
    _registeredNo = _tongyifield.text;
}if (textField ==_comnamefield) {
    _name = _comnamefield.text;
}if (textField ==_comphonefield) {
    _phonenumber = _comphonefield.text;
}if (textField ==_comchuanzhenfield) {
    _fax = _comchuanzhenfield.text;
}if (textField ==_perbumenfield) {
    _applyDepartmentName = _perbumenfield.text;
}if (textField ==_perzhiweifield) {
    _applyPostName = _perzhiweifield.text;
}if (textField ==_areaifield) {
    _address = _areaifield.text;
}if (textField ==_youbianfield) {
    _zipCode = _youbianfield.text;
}if (textField ==_zijinfield) {
    _registeredCapital = _zijinfield.text;
}if (textField ==_compersonfield) {
    _lagalPerson = _compersonfield.text;
}if (textField ==_dengjifield) {
    _dengji = _dengjifield.text;
}if (textField ==_comwebfield) {
    _website = _comwebfield.text;
}if (textField ==_comlogofield) {
    _logo = _comlogofield.text;
}

}
- (void)textViewDidEndEditing:(UITextView *)textView{
if (textView ==_jingyingfield) {
    _businessScope = _jingyingfield.text;
}if (textView ==_miaoshufield) {
    _remark = _miaoshufield.text;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row ==0) {
 static NSString *cellid00 = @"cellid00";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid00];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid00];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

  UILabel *label0 = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, KScreenWidth-20, 30)];
    label0.textColor = [UIColor colorWithHexString:@"0a62ea"];
    label0.text = NSLocalizedString(@"企业中文基本信息", nil);
        [cell.contentView addSubview:label0];
        NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*统一信用代码", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, label0.bottom,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 _tongyifield = [[zhucetextfield alloc]init];
// _tongyifield.isEditing = NO;
              _tongyifield.delegate = self;
 _tongyifield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//_tongyifield.text = @"91330421550521740Q";
  [_tongyifield addTarget:self action:@selector(idendediting) forControlEvents:UIControlEventEditingDidEnd];// 可在自定义selector处
             [cell.contentView addSubview:_tongyifield];
    
}

    if(![httpTool isBlankString:_registeredNo]){
 _tongyifield.text =_registeredNo;
 NSLog(@"1111111");
 }
return cell;
}else if (indexPath.row ==1) {
 static NSString *cellid1 = @"cellid1";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid1];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid1];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

           NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*公司名称", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 _comnamefield = [[zhucetextfield alloc]init];
              _comnamefield.delegate = self;
 _comnamefield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
 
//      _shangpinname.keyboardType = UIKeyboardTypeASCIICapable;
             [cell.contentView addSubview:_comnamefield];
    
}
  if(![_dict isEqual:[NSNull null]]&&![_name isEqual:[NSNull null]]){
 _comnamefield.text =_name;
 
 }

return cell;
}else if (indexPath.row ==2) {
 static NSString *cellid2 = @"cellid2";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid2];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid2];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

          NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"公司电话", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
label.text = string;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 _comphonefield = [[zhucetextfield alloc]init];
              _comphonefield.delegate = self;
 _comphonefield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//      _shangpinname.keyboardType = UIKeyboardTypeASCIICapable;
             [cell.contentView addSubview:_comphonefield]; }
 
  if((![_dict isEqual:[NSNull null]])&&(![httpTool isBlankString:_phonenumber])){
 _comphonefield.text =_phonenumber;
 
 }
return cell;
}else if (indexPath.row ==3) {
 static NSString *cellid3 = @"cellid3";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid3];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid3];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

          NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"公司传真", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
label.text = string;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 _comchuanzhenfield = [[zhucetextfield alloc]init];
              _comchuanzhenfield.delegate = self;
 _comchuanzhenfield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//      _shangpinname.keyboardType = UIKeyboardTypeASCIICapable;
             [cell.contentView addSubview:_comchuanzhenfield];  }
  if(![_dict isEqual:[NSNull null]]&&![_fax isEqual:[NSNull null]]){
 _comchuanzhenfield.text =_fax;
 
 }

return cell;
}else if (indexPath.row ==4) {
 static NSString *cellid4 = @"cellid4";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid4];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid4];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

        NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*申请人部门", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 _perbumenfield = [[zhucetextfield alloc]init];
              _perbumenfield.delegate = self;
 _perbumenfield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//      _shangpinname.keyboardType = UIKeyboardTypeASCIICapable;
             [cell.contentView addSubview:_perbumenfield];  }
   if(![_dict isEqual:[NSNull null]]&&![_applyDepartmentName isEqual:[NSNull null]]){
 _perbumenfield.text =_applyDepartmentName;

 }
  
return cell;
}else if (indexPath.row ==5) {
 static NSString *cellid5 = @"cellid5";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid5];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid5];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

         NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*申请人职位", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
 _perzhiweifield = [[zhucetextfield alloc]init];
              _perzhiweifield.delegate = self;
    _perzhiweifield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//      _shangpinname.keyboardType = UIKeyboardTypeASCIICapable;
             [cell.contentView addSubview:_perzhiweifield];  }
  if(![_dict isEqual:[NSNull null]]&&![_applyPostName isEqual:[NSNull null]]){
 _perzhiweifield.text =_applyPostName;

 }
 
return cell;
}else if (indexPath.row ==6) {
 static NSString *cellid6 = @"cellid6";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid6];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid6];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

  NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*所属区域", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
  _Countrybutton = [zhucebutton buttonWithType:UIButtonTypeCustom];
      _Countrybutton.frame = CGRectMake(10, label.bottom, (KScreenWidth-30)/2, 40);
      [_Countrybutton setTitle:NSLocalizedString(@"请选择国家", nil) forState:UIControlStateNormal];
[_Countrybutton addTarget:self action:@selector(countryaction) forControlEvents:UIControlEventTouchUpInside];
      [_Countrybutton setImage:[UIImage imageNamed:@"下拉"] forState:UIControlStateNormal];
       [_Countrybutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight
                                    imageTitleSpace:20];
//    _Countrybutton.enabled = NO;
   [cell.contentView addSubview:_Countrybutton];
   
   _Provincebutton = [zhucebutton buttonWithType:UIButtonTypeCustom];
      _Provincebutton.frame = CGRectMake(_Countrybutton.right+10, label.bottom, (KScreenWidth-30)/2, 40);
    [_Provincebutton setTitle:NSLocalizedString(@"请选择省份", nil) forState:UIControlStateNormal];
     [_Provincebutton setImage:[UIImage imageNamed:@"下拉"] forState:UIControlStateNormal];
     [_Provincebutton addTarget:self action:@selector(Provinceaction) forControlEvents:UIControlEventTouchUpInside];
//    _Provincebutton.enabled = NO;

       [_Provincebutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight
                                    imageTitleSpace:20];
   [cell.contentView addSubview:_Provincebutton];

  _citybutton = [zhucebutton buttonWithType:UIButtonTypeCustom];
      _citybutton.frame = CGRectMake(10, _Countrybutton.bottom+5, (KScreenWidth-30)/2, 40);
       [_citybutton setImage:[UIImage imageNamed:@"下拉"] forState:UIControlStateNormal];
           [_citybutton setTitle:NSLocalizedString(@"请选择市", nil) forState:UIControlStateNormal];
     [_citybutton addTarget:self action:@selector(cityeaction) forControlEvents:UIControlEventTouchUpInside];
//    _citybutton.enabled = NO;

       [_citybutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight
                                    imageTitleSpace:20];
   [cell.contentView addSubview:_citybutton];
    _Villagebutton = [zhucebutton buttonWithType:UIButtonTypeCustom];
      _Villagebutton.frame = CGRectMake(_citybutton.right+10, _Countrybutton.bottom+5, (KScreenWidth-30)/2, 40);
       [_Villagebutton setImage:[UIImage imageNamed:@"下拉"] forState:UIControlStateNormal];
           [_Villagebutton setTitle:NSLocalizedString(@"请选择区县", nil) forState:UIControlStateNormal];
     [_Villagebutton addTarget:self action:@selector(Villageaction) forControlEvents:UIControlEventTouchUpInside];
//    _Villagebutton.enabled = NO;

       [_Villagebutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight
                                    imageTitleSpace:20];
   [cell.contentView addSubview:_Villagebutton];
   
   
  
   
}
 
 if(![_dic[@"selSheng"] isEqual:[NSNull null]]&&![_shengname isEqual:[NSNull null]]){
    [_Provincebutton setTitle:_shengname forState:UIControlStateNormal];
//_shengname =_dic[@"selSheng"][@"areaname"];
//_shengid =_dic[@"selSheng"][@"id"];
 }
   
if(![_dic[@"selGj"] isEqual:[NSNull null]]&&![_countryname isEqual:[NSNull null]]){
    [_Countrybutton setTitle:_countryname forState:UIControlStateNormal];
//_countryname =_dic[@"selGj"][@"areaname"];
//_countryid =_dic[@"selGj"][@"id"];
 }
  if(![_dic[@"selShi"] isEqual:[NSNull null]]&&![_shiname isEqual:[NSNull null]]){
    [_citybutton setTitle:_shiname forState:UIControlStateNormal];
//_shiname =_dic[@"selShi"][@"areaname"];
//_shiid =_dic[@"selShi"][@"id"];
 }
    if(![_dic[@"selQx"] isEqual:[NSNull null]]&&![_quname isEqual:[NSNull null]]){
    [_Villagebutton setTitle:_quname forState:UIControlStateNormal];
//_quname =_dic[@"selQx"][@"areaname"];
//_quid =_dic[@"selQx"][@"id"];
 }
 
 

return cell;
}else if (indexPath.row ==7) {
 static NSString *cellid7 = @"cellid7";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid7];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid7];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

     NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*详细地址", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
     _areaifield = [[zhucetextfield alloc]init];
              _areaifield.delegate = self;
    _areaifield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//      _shangpinname.keyboardType = UIKeyboardTypeASCIICapable;
             [cell.contentView addSubview:_areaifield];   }
    if(![_dict isEqual:[NSNull null]]&&![_address isEqual:[NSNull null]]){
 _areaifield.text =_address;

 }
    
  
return cell;
}else if (indexPath.row ==8) {
 static NSString *cellid8 = @"cellid8";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid8];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid8];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

       NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*所属协商会", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
                 _suoshubutton = [zhucebutton buttonWithType:UIButtonTypeCustom];

      _suoshubutton.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
      UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(KScreenWidth-50,10 , 20, 20)];
image.image = [UIImage imageNamed:@"下拉"];
[_suoshubutton addSubview:image];
[_suoshubutton addTarget:self action:@selector(suoshuaction) forControlEvents:UIControlEventTouchUpInside];
//_suoshubutton.enabled = NO;
//       [_suoshubutton setImage:[UIImage imageNamed:@"下拉"] forState:UIControlStateNormal];
//       [_suoshubutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight
//                                    imageTitleSpace:(KScreenWidth- 60)];
   [cell.contentView addSubview:_suoshubutton];  }
 
       if(![_dic isEqual:[NSNull null]]&&![_organizationname isEqual:[NSNull null]]){
    [_suoshubutton setTitle:_organizationname forState:UIControlStateNormal];
//_organizationname =_dic[@"selOrg"][@"orgname"];
//_organizationid =_dic[@"selOrg"][@"id"];
 }
  
return cell;
}else if (indexPath.row ==9) {
 static NSString *cellid9 = @"cellid9";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid9];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid9];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

   NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"邮编", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
label.text = string;
//label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
              _youbianfield = [[zhucetextfield alloc]init];
              _youbianfield.delegate = self;
    _youbianfield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//      _shangpinname.keyboardType = UIKeyboardTypeASCIICapable;
             [cell.contentView addSubview:_youbianfield];   }
 
        if(_dict&&![_zipCode isEqual:[NSNull null]]){
 _youbianfield.text =_zipCode;

 }
return cell;
}else if (indexPath.row ==10) {
 static NSString *cellid10 = @"cellid10";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid10];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid10];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

         NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*注册资本金额", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
       _zijinfield = [[zhucetextfield alloc]init];
              _zijinfield.delegate = self;
    _zijinfield.frame = CGRectMake(10, label.bottom, (KScreenWidth-40)/3, 40);
      _zijinfield.keyboardType = UIKeyboardTypeNumberPad;
             [cell.contentView addSubview:_zijinfield];
             _jishubutton = [zhucebutton buttonWithType:UIButtonTypeCustom];
      _jishubutton.frame = CGRectMake(_zijinfield.right+10, label.bottom, (KScreenWidth-30-_zijinfield.width), 40);
       [_jishubutton setImage:[UIImage imageNamed:@"下拉"] forState:UIControlStateNormal];
           [_jishubutton setTitle:NSLocalizedString(@"请选择计数单位", nil) forState:UIControlStateNormal];
           [_jishubutton addTarget:self action:@selector(jishuaction) forControlEvents:UIControlEventTouchUpInside];
//_jishubutton.enabled = NO;
       [_jishubutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight
                                    imageTitleSpace:(20)];
   [cell.contentView addSubview:_jishubutton];
      _huobibutton = [zhucebutton buttonWithType:UIButtonTypeCustom];
      _huobibutton.frame = CGRectMake(_zijinfield.right+10, _jishubutton.bottom+5, (KScreenWidth-30-_zijinfield.width), 40);
           [_huobibutton addTarget:self action:@selector(huobiaction) forControlEvents:UIControlEventTouchUpInside];
       [_huobibutton setImage:[UIImage imageNamed:@"下拉"] forState:UIControlStateNormal];
           [_huobibutton setTitle:NSLocalizedString(@"请选择货币单位", nil) forState:UIControlStateNormal];
//           _huobibutton.enabled = NO;

       [_huobibutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight
                                    imageTitleSpace:(20)];
   [cell.contentView addSubview:_huobibutton];  }
  if(![_dict isEqual:[NSNull null]]&&![_registeredCapital isEqual:[NSNull null]]){
      _zijinfield.text =[NSString stringWithFormat:@"%@",_registeredCapital];
//            _zijinfield.text =_dict[@"regcapital"];

 [_jishubutton setTitle:_countUnitListname forState:UIControlStateNormal];
//_countUnitListid = _dict[@"countUnit"];
 [_huobibutton setTitle:_monetaryUnitname forState:UIControlStateNormal];
//_monetaryUnitid = _dict[@"monetaryUnit"];
      

 }
 
return cell;
}else if (indexPath.row ==11) {
 static NSString *cellid11 = @"cellid11";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid11];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid11];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

     NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*公司成立时间", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
                 _comstartbutton = [zhucebutton buttonWithType:UIButtonTypeCustom];

      _comstartbutton.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//       [_comstartbutton setImage:[UIImage imageNamed:@"日期"] forState:UIControlStateNormal];
//       [_comstartbutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight
//                                    imageTitleSpace:(KScreenWidth- 60)];
UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(KScreenWidth-50,10 , 20, 20)];
image.image = [UIImage imageNamed:@"日期"];
[_comstartbutton addSubview:image];
[_comstartbutton addTarget:self action:@selector(setupaction) forControlEvents:UIControlEventTouchUpInside];
//_comstartbutton.enabled = NO;
   [cell.contentView addSubview:_comstartbutton];
   
}
  if(![_dict isEqual:[NSNull null]]&&![_setuptime isEqual:[NSNull null]]){
    [_comstartbutton setTitle:_setuptime forState:UIControlStateNormal];
//_setuptime =_dict[@"registerDate"];
//_organizationid =_dic[@"selOrg"][@"id"];
 }
    
  
return cell;
}else if (indexPath.row ==12) {
 static NSString *cellid12 = @"cellid12";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid12];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid12];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

       NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*经营期限开始时间", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
                _starttimebutton= [zhucebutton buttonWithType:UIButtonTypeCustom];

      _starttimebutton.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//       [_starttimebutton setImage:[UIImage imageNamed:@"日期"] forState:UIControlStateNormal];
//       [_starttimebutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight
//                                    imageTitleSpace:(KScreenWidth- 60)];
UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(KScreenWidth-50,10 , 20, 20)];
image.image = [UIImage imageNamed:@"日期"];
[_starttimebutton addSubview:image];
//_starttimebutton.enabled = NO;

[_starttimebutton addTarget:self action:@selector(startaction) forControlEvents:UIControlEventTouchUpInside];
   [cell.contentView addSubview:_starttimebutton]; }
  if(![_dict isEqual:[NSNull null]]&&![_starttime isEqual:[NSNull null]]){
    [_starttimebutton setTitle:_starttime forState:UIControlStateNormal];
//_starttime =_dict[@"startDate"];
//_organizationid =_dic[@"selOrg"][@"id"];
 }
    
  
return cell;
}else if (indexPath.row ==13) {
 static NSString *cellid13 = @"cellid13";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid13];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid13];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

      NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*经营期限结束时间", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
                _endtimebutton= [zhucebutton buttonWithType:UIButtonTypeCustom];
//_endtimebutton.enabled = NO;

      _endtimebutton.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//       [_endtimebutton setImage:[UIImage imageNamed:@"日期"] forState:UIControlStateNormal];
//       [_endtimebutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight
//                                    imageTitleSpace:(KScreenWidth- 60)];
UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(KScreenWidth-50,10 , 20, 20)];
image.image = [UIImage imageNamed:@"日期"];
[_endtimebutton addSubview:image];
[_endtimebutton addTarget:self action:@selector(endaction) forControlEvents:UIControlEventTouchUpInside];
   [cell.contentView addSubview:_endtimebutton];  }
 
   if(![_dict isEqual:[NSNull null]]&&![_endtime isEqual:[NSNull null]]){
    [_endtimebutton setTitle:_endtime forState:UIControlStateNormal];
//_endtime =_dict[@"endDate"];
//_organizationid =_dic[@"selOrg"][@"id"];
 }
  
return cell;
}else if (indexPath.row ==14) {
 static NSString *cellid14 = @"cellid14";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid14];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid14];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

     NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*公司类型", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
                _comtypebutton= [zhucebutton buttonWithType:UIButtonTypeCustom];
//_comtypebutton.enabled = NO;
      _comtypebutton.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
        UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(KScreenWidth-50,10 , 20, 20)];
image.image = [UIImage imageNamed:@"下拉"];
[_comtypebutton addSubview:image];
[_comtypebutton addTarget:self action:@selector(comtypeaction) forControlEvents:UIControlEventTouchUpInside];
//       [_comtypebutton setImage:[UIImage imageNamed:@"下拉"] forState:UIControlStateNormal];
//       [_comtypebutton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight
//                                    imageTitleSpace:(KScreenWidth- 60)];
   [cell.contentView addSubview:_comtypebutton];  }
 
 if(![_dic isEqual:[NSNull null]]&&![_cptypename isEqual:[NSNull null]]){
    [_comtypebutton setTitle:_cptypename forState:UIControlStateNormal];
//_cptypename =_dic[@"selCptype"][@"dictname"];
//_cptypeid =_dic[@"selCptype"][@"id"];
 }
  
return cell;
}else if (indexPath.row ==15) {
 static NSString *cellid15 = @"cellid15";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid15];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid15];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

      NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*法定代表人", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
    
                _compersonfield = [[zhucetextfield alloc]init];
              _compersonfield.delegate = self;
    _compersonfield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//      _shangpinname.keyboardType = UIKeyboardTypeASCIICapable;
             [cell.contentView addSubview:_compersonfield];  }
 
     if(![_dict isEqual:[NSNull null]]&&![_lagalPerson isEqual:[NSNull null]]){
 _compersonfield.text =_lagalPerson;

 }
  
return cell;
}else if (indexPath.row ==16) {
 static NSString *cellid16 = @"cellid16";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid16];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid16];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

        NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"登记机关", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
label.text = string;
//label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
    
                _dengjifield = [[zhucetextfield alloc]init];
              _dengjifield.delegate = self;
    _dengjifield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//      _shangpinname.keyboardType = UIKeyboardTypeASCIICapable;
             [cell.contentView addSubview:_dengjifield]; }
 
     if(![_dict isEqual:[NSNull null]]&&![_dengji isEqual:[NSNull null]]){
 _dengjifield.text =_dengji;

 }
  
return cell;
}else if (indexPath.row ==17) {
 static NSString *cellid17 = @"cellid17";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid17];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid17];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

     NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*经营范围", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
    
    _jingyingfield = [[UITextView alloc]init];
              _jingyingfield.delegate = self;
    _jingyingfield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 80);
  _jingyingfield.layer.cornerRadius=8.0f;
   _jingyingfield.layer.masksToBounds=YES;
    _jingyingfield.layer.borderColor=[[UIColor grayColor]CGColor];
    _jingyingfield.layer.borderWidth= 1.0f;
          [cell.contentView addSubview:_jingyingfield]; }
  if(![_dict isEqual:[NSNull null]]&&![_businessScope isEqual:[NSNull null]]){
 _jingyingfield.text =_businessScope;

 }
  
    
  
return cell;
}else if (indexPath.row ==18) {
 static NSString *cellid18 = @"cellid18";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid18];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid18];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;

 
        NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*行业分类", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
    _leimubutton = [zhucebutton buttonWithType:UIButtonTypeCustom];
//    _leimubutton.enabled = NO;
      _leimubutton.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
//       [_leimubutton setImage:[UIImage imageNamed:@"下拉"] forState:UIControlStateNormal];
//_leimubutton.titleEdgeInsets = UIEdgeInsetsMake(0,0, 0, 50);
UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(KScreenWidth-50,10 , 20, 20)];
image.image = [UIImage imageNamed:@"下拉"];
[_leimubutton addSubview:image];
 
[_leimubutton addTarget:self action:@selector(leimuaction) forControlEvents:UIControlEventTouchUpInside];

   [cell.contentView addSubview:_leimubutton];
   }
   if(![_dic isEqual:[NSNull null]]&&![_selCategoryName isEqual:[NSNull null]]){

    [_leimubutton setTitle:_selCategoryName forState:UIControlStateNormal];

//_selCategoryName =_dic[@"selCategoryName"];
//
//_leimuid =_dic[@"selCptype"][@"id"];

 }
return cell;
}else if (indexPath.row ==19) {
 static NSString *cellid19 = @"cellid19";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid19];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid19];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

     NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"公司网站", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
label.text = string;
//label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
    
    _comwebfield = [[zhucetextfield alloc]init];
              _comwebfield.delegate = self;
    _comwebfield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
 
          [cell.contentView addSubview:_comwebfield]; }
 
   if(![_dict isEqual:[NSNull null]]&&![_website isEqual:[NSNull null]]){
 _comwebfield.text =_website;

 }
  
return cell;
}else if (indexPath.row ==20) {
 static NSString *cellid20 = @"cellid20";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid20];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid20];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

     NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"公司商标", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
label.text = string;
//label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
    
    _comlogofield = [[zhucetextfield alloc]init];
              _comlogofield.delegate = self;
    _comlogofield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 40);
 
          [cell.contentView addSubview:_comlogofield]; }
 if(_dict&&![_logo isEqual:[NSNull null]]){

 _comlogofield.text =_logo;


 }
    
  
return cell;
}else if (indexPath.row ==21) {
 static NSString *cellid21 = @"cellid21";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid21];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid21];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

     NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"公司logo", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
label.text = string;
//label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
    
    _comlogo = [[ACSelectMediaView alloc] initWithFrame:CGRectMake(10, label.bottom, KScreenWidth-20, (kScreenWidth-16 - 2 * 3) / 4+10)];
    _comlogo.showDelete = YES;
    _comlogo.showAddButton = YES;
   _comlogo.maxImageSelected = 1;
   [_comlogo observeSelectedMediaArray:^(NSArray<ACMediaModel *> *list) {
    _comlogoimage = list;
          if (list.count ==1) {
  for (ACMediaModel *model in list) {
 if([httpTool isBlankString: model.imageUrlString]){
 NSMutableDictionary *dict1 = [_dict mutableCopy];
 [dict1 removeObjectForKey:@"tologoImage"];
 _dict = dict1;
 }
 }
 }
    }];
      _comlogo.allowMultipleSelection = YES;
    [cell.contentView addSubview:_comlogo];
//   [_mediaView observeViewHeight:^(CGFloat mediaHeight) {
//     [_tableView reloadData];
//    }];
   
}
  if([[_dict allKeys] containsObject:@"tologoImage"]){

 if(_dict&&![_dict[@"tologoImage"] isEqual:[NSNull null]])
   {
// _comwebfield.text =_dict[@"website"];
 NSMutableArray *array =  [NSMutableArray array];
 [array addObject:_dict[@"tologoImage"]];
_comlogo.preShowMedias  = array;

 }
  }
return cell;
}else if (indexPath.row ==22) {
 static NSString *cellid22 = @"cellid22";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid22];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid22];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

     NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"公司场景图片", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
label.text = string;
//label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
    
    _complace = [[ACSelectMediaView alloc] initWithFrame:CGRectMake(10, label.bottom, KScreenWidth-20, (kScreenWidth-16 - 2 * 3) / 4+10)];
    _complace.showDelete = YES;
    _complace.showAddButton = YES;
   _complace.maxImageSelected = 1;
   [_complace observeSelectedMediaArray:^(NSArray<ACMediaModel *> *list) {
    _complaceimage = list;
      if (list.count ==1) {
  for (ACMediaModel *model in list) {
 if([httpTool isBlankString: model.imageUrlString]){
 NSMutableDictionary *dict1 = [_dict mutableCopy];
 [dict1 removeObjectForKey:@"tosceneImage"];
 _dict = dict1;
 }
 }
 }
    }];
         _complace.allowMultipleSelection = YES;
    [cell.contentView addSubview:_complace];

   
}
 if([[_dict allKeys] containsObject:@"tosceneImage"]){

 if(_dict&&![_dict[@"tosceneImage"] isEqual:[NSNull null]])
   {
// _comwebfield.text =_dict[@"website"];
 NSMutableArray *array =  [NSMutableArray array];
 [array addObject:_dict[@"tosceneImage"]];
_complace.preShowMedias  = array;

 }
 }
return cell;
}
else if (indexPath.row ==23) {
 static NSString *cellid23 = @"cellid23";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid23];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid23];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

     NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*营业执照复印件", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
    
    _comCer = [[ACSelectMediaView alloc] initWithFrame:CGRectMake(10, label.bottom, KScreenWidth-20, (kScreenWidth-16 - 2 * 3) / 4+10)];
   
    _comCer.showDelete = YES;
    _comCer.showAddButton = YES;
   _comCer.maxImageSelected = 1;
   [_comCer observeSelectedMediaArray:^(NSArray<ACMediaModel *> *list) {
    _comCerimage = list;
  if (list.count ==1) {
  for (ACMediaModel *model in list) {
 if([httpTool isBlankString: model.imageUrlString]){
 NSMutableDictionary *dict1 = [_dict mutableCopy];
 [dict1 removeObjectForKey:@"tobusinessLicense"];
 _dict = dict1;
 }
 }
 }
    }];
         _comCer.allowMultipleSelection = YES;
    [cell.contentView addSubview:_comCer];

   
}
 if([[_dict allKeys] containsObject:@"tobusinessLicense"]){

   if(_dict&&![_dict[@"tobusinessLicense"] isEqual:[NSNull null]])
   {
// _comwebfield.text =_dict[@"website"];
 NSMutableArray *array =  [NSMutableArray array];
 [array addObject:_dict[@"tobusinessLicense"]];
_comCer.preShowMedias  = array;
}
 }
return cell;
}else if (indexPath.row ==24) {
 static NSString *cellid24 = @"cellid24";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid24];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid24];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

     NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"营业执照是否公开", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,150, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
label.text = string;
//label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
           _judgebox = [judgebox checkBoxFootView];
 _judgebox.frame = CGRectMake(label.right,0,KScreenWidth-20-50-100-50, 20);
  [_judgebox setSelectRowBlock:^(NSString *rowTitle) {
    _isOpen = rowTitle;

}];
             [cell.contentView addSubview:_judgebox];
   
}
  if(_dict&&![_dict[@"isOpen"] isEqual:[NSNull null]]){

_isOpen =[NSString stringWithFormat:@"%@",_dict[@"isOpen"]];

 }
if ([_isOpen isEqualToString:@"1"]) {
        _judgebox.seltag = 1;

}else{
    _judgebox.seltag = 0;

}
return cell;
}else if (indexPath.row ==25) {
//
 static NSString *cellid25 = @"cellid25";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellid25];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellid25];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

     NSString *string =[NSString stringWithFormat:@"%@",NSLocalizedString(@"*公司描述", nil)];
   NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
      [attrStr addAttribute:NSForegroundColorAttributeName
                value:[UIColor redColor]
                range:NSMakeRange(0, 1)];
  UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,KScreenWidth-20, 20)];
  label.textColor = [UIColor colorWithHexString:@"484848"];
//label.text = string;
label.attributedText = attrStr;
    label.font = [UIFont systemFontOfSize:14];
    [cell.contentView addSubview:label];
    
    _miaoshufield = [[UITextView alloc]init];
              _miaoshufield.delegate = self;
    _miaoshufield.frame = CGRectMake(10, label.bottom, (KScreenWidth-20), 80);
  _miaoshufield.layer.cornerRadius=8.0f;
   _miaoshufield.layer.masksToBounds=YES;
    _miaoshufield.layer.borderColor=[[UIColor grayColor]CGColor];
    _miaoshufield.layer.borderWidth= 1.0f;
          [cell.contentView addSubview:_miaoshufield]; }
 
   if(![_dict isEqual:[NSNull null]]&&![_remark isEqual:[NSNull null]]){
 _miaoshufield.text =_remark;
// NSMutableArray *array =  [NSMutableArray array];
// [array addObject:_dict[@"remark"]];
//_comCer.preShowMedias  = array;

 }
  
return cell;
}else{
     static NSString *CellIdentifier2 = @"Cellbendititlepic2";

    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:CellIdentifier2];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier2];
//        cell.backgroundColor = [UIColor colorWithHexString:@"f0eff5"];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;

    }
     UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
      button.frame = CGRectMake(20, 10, KScreenWidth-40, 40);
button.backgroundColor = [UIColor colorWithHexString:@"0a62ea"];

    [button setTitle:NSLocalizedString(@"提交", nil) forState:UIControlStateNormal];
    button.titleLabel.font = [UIFont systemFontOfSize: 15.0];
    [button setTitleColor:[UIColor whiteColor]forState:UIControlStateNormal];
        button.layer.cornerRadius = button.height/2;
        [button addTarget:self action:@selector(baocunaction) forControlEvents:UIControlEventTouchUpInside];
    
[cell.contentView addSubview:button];
    return cell;
    
  
    }

}
- (void)countryaction{
NSArray *array = _dic[@"areaList"];
//NSMutableArray *muaarray = [NSMutableArray array];
//for (NSDictionary *dic in array) {
//    [muaarray addObject:dic[@"name"]];
//}
[self.lzPickerVIew lzPickerVIewType:LZPickerViewTypeSexAndHeight];
self.lzPickerVIew.dataSource =_countryList;
 [self.lzPickerVIew show];
         __weak typeof(self) weakSelf = self;

 self.lzPickerVIew.selectValue  = ^(NSString *value){

        [weakSelf.Countrybutton setTitle:value forState:UIControlStateNormal];
      _countryname = value;
     for (NSDictionary *dic in array) {
   
   if ([value isEqualToString:dic[@"areaname"]]) {
   _countryid = dic[@"id"];
}
}
    };
}
- (void)Provinceaction{
NSDictionary *dict = [NSDictionary dictionary];
for (NSDictionary *dic in _areaList) {
    if ([dic[@"areaname"]isEqualToString:_countryname]) {
    dict = dic;
}
}
NSMutableArray *muasheng = [NSMutableArray array];
NSArray *array  = dict[@"shenglist"];
if (array.count>0) {
_shenglist = array;
    for (NSDictionary *dic in array) {
    [muasheng addObject:dic[@"areaname"]];
}
    [self.lzPickerVIew lzPickerVIewType:LZPickerViewTypeSexAndHeight];
self.lzPickerVIew.dataSource =muasheng;
 [self.lzPickerVIew show];
    
      __weak typeof(self) weakSelf = self;

 self.lzPickerVIew.selectValue  = ^(NSString *value){

        [weakSelf.Provincebutton setTitle:value forState:UIControlStateNormal];
      _shengname = value;
     for (NSDictionary *dic in array) {
   
   if ([value isEqualToString:dic[@"areaname"]]) {
   _countryid = dic[@"id"];
}
}
    };
    
}else if(_countryname){

[self.view makeToast: NSLocalizedString(@"省份为空", nil)];
}else{
[self.view makeToast: NSLocalizedString(@"请选择国家", nil)];


}
}
-(void)cityeaction{
NSDictionary *dict = [NSDictionary dictionary];
for (NSDictionary *dic in _shenglist) {
    if ([dic[@"areaname"]isEqualToString:_shengname]) {
    dict = dic;
}
}
NSMutableArray *muashi = [NSMutableArray array];
NSArray *array  = dict[@"shilist"];
if (array.count>0) {
_shilist = array;
    for (NSDictionary *dic in array) {
    [muashi addObject:dic[@"areaname"]];
}
 [self.lzPickerVIew lzPickerVIewType:LZPickerViewTypeSexAndHeight];
self.lzPickerVIew.dataSource =muashi;
 [self.lzPickerVIew show];
    __weak typeof(self) weakSelf = self;

 self.lzPickerVIew.selectValue  = ^(NSString *value){

        [weakSelf.citybutton setTitle:value forState:UIControlStateNormal];
      _shiname = value;
     for (NSDictionary *dic in array) {
   
   if ([value isEqualToString:dic[@"areaname"]]) {
   _shiid = dic[@"id"];
}
}
    };
}else if(_shengname){

[self.view makeToast: NSLocalizedString(@"市为空", nil)];
}else{
[self.view makeToast: NSLocalizedString(@"请选择省", nil)];


}

}
-(void)Villageaction{
NSDictionary *dict = [NSDictionary dictionary];
for (NSDictionary *dic in _shilist) {
    if ([dic[@"areaname"]isEqualToString:_shiname]) {
    dict = dic;
}
}
NSMutableArray *muaqu = [NSMutableArray array];
NSArray *array  = dict[@"qxlist"];
if (array.count>0) {
_qulist = array;
    for (NSDictionary *dic in array) {
    [muaqu addObject:dic[@"areaname"]];
}
 [self.lzPickerVIew lzPickerVIewType:LZPickerViewTypeSexAndHeight];
self.lzPickerVIew.dataSource =muaqu;
 [self.lzPickerVIew show];
    __weak typeof(self) weakSelf = self;

 self.lzPickerVIew.selectValue  = ^(NSString *value){

        [weakSelf.Villagebutton setTitle:value forState:UIControlStateNormal];
      _quname = value;
     for (NSDictionary *dic in array) {
   
   if ([value isEqualToString:dic[@"areaname"]]) {
   _quid = dic[@"id"];
}
}
    };
}else if(_shiname){

[self.view makeToast: NSLocalizedString(@"区县为空", nil)];
}else{
[self.view makeToast: NSLocalizedString(@"请选择市", nil)];


}
}
- (void)suoshuaction{
if (_organizationList.count>0) {
    [self.lzPickerVIew lzPickerVIewType:LZPickerViewTypeSexAndHeight];
self.lzPickerVIew.dataSource =_organizationList;
 [self.lzPickerVIew show];
    __weak typeof(self) weakSelf = self;
NSArray *array =   _dic[@"organizationList"];
 self.lzPickerVIew.selectValue  = ^(NSString *value){

        [weakSelf.suoshubutton setTitle:value forState:UIControlStateNormal];
      _organizationname = value;
     for (NSDictionary *dic in array) {
   
   if ([value isEqualToString:dic[@"orgname"]]) {
   _organizationid = dic[@"id"];
}
}
    };
}

}

- (void)jishuaction{
if (_countUnitList.count>0) {
    [self.lzPickerVIew lzPickerVIewType:LZPickerViewTypeSexAndHeight];
self.lzPickerVIew.dataSource =_countUnitList;
 [self.lzPickerVIew show];
    __weak typeof(self) weakSelf = self;
NSArray *array =   _dic[@"countUnitList"];
 self.lzPickerVIew.selectValue  = ^(NSString *value){

        [weakSelf.jishubutton setTitle:value forState:UIControlStateNormal];
      _countUnitListname = value;
     for (NSDictionary *dic in array) {
   
   if ([value isEqualToString:dic[@"dictname"]]) {
   _countUnitListid = dic[@"id"];
}
}
    };
}

}
- (void)huobiaction{
if (_monetaryUnitList.count>0) {
    [self.lzPickerVIew lzPickerVIewType:LZPickerViewTypeSexAndHeight];
self.lzPickerVIew.dataSource =_monetaryUnitList;
 [self.lzPickerVIew show];
    __weak typeof(self) weakSelf = self;
NSArray *array =   _dic[@"monetaryUnitList"];
 self.lzPickerVIew.selectValue  = ^(NSString *value){

        [weakSelf.huobibutton setTitle:value forState:UIControlStateNormal];
      _monetaryUnitname = value;
     for (NSDictionary *dic in array) {
   
   if ([value isEqualToString:dic[@"dictname"]]) {
   _monetaryUnitid = dic[@"id"];
}
}
    };
}

}
- (void)comtypeaction{
if (_cptypeList.count>0) {
    [self.lzPickerVIew lzPickerVIewType:LZPickerViewTypeSexAndHeight];
self.lzPickerVIew.dataSource =_cptypeList;
 [self.lzPickerVIew show];
    __weak typeof(self) weakSelf = self;
NSArray *array =   _dic[@"cptypeList"];
 self.lzPickerVIew.selectValue  = ^(NSString *value){

        [weakSelf.comtypebutton setTitle:value forState:UIControlStateNormal];
      _cptypename = value;
     for (NSDictionary *dic in array) {
   
   if ([value isEqualToString:dic[@"dictname"]]) {
   _cptypeid = dic[@"id"];
}
}
    };
}

}
- (void)setupaction{
_setupPicker = [[MHDatePicker alloc] init];
    _setupPicker.isBeforeTime = YES;
    _setupPicker.datePickerMode = UIDatePickerModeDate;
    
    __weak typeof(self) weakSelf = self;
    [_setupPicker didFinishSelectedDate:^(NSDate *selectedDate) {
//        NSString *string = [NSString stringWithFormat:@"%@",[NSDate dateWithTimeInterval:3600*8 sinceDate:selectedDate]];
//        weakSelf.myLabel2.text = string;
      NSString *string = [weakSelf dateStringWithDate:selectedDate DateFormat:@"yyyy-MM-dd"];
      _setuptime = string;
      [weakSelf.comstartbutton setTitle:string forState:UIControlStateNormal];
    }];

}

- (NSString *)dateStringWithDate:(NSDate *)date DateFormat:(NSString *)dateFormat
{
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:dateFormat];
    [dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]];
    NSString *str = [dateFormatter stringFromDate:date];
    return str ? str : @"";
}
- (void)startaction{
_startPicker = [[MHDatePicker alloc] init];
    _startPicker.isBeforeTime = YES;
    _startPicker.datePickerMode = UIDatePickerModeDate;
    
    __weak typeof(self) weakSelf = self;
    [_startPicker didFinishSelectedDate:^(NSDate *selectedDate) {
//        NSString *string = [NSString stringWithFormat:@"%@",[NSDate dateWithTimeInterval:3600*8 sinceDate:selectedDate]];
//        weakSelf.myLabel2.text = string;
      NSString *string = [weakSelf dateStringWithDate:selectedDate DateFormat:@"yyyy-MM-dd"];
      _starttime = string;
      [weakSelf.starttimebutton setTitle:string forState:UIControlStateNormal];
    }];

}
- (void)endaction{
_endPicker = [[MHDatePicker alloc] init];
    _endPicker.isBeforeTime = YES;
    _endPicker.datePickerMode = UIDatePickerModeDate;
    
    __weak typeof(self) weakSelf = self;
    [_endPicker didFinishSelectedDate:^(NSDate *selectedDate) {
//        NSString *string = [NSString stringWithFormat:@"%@",[NSDate dateWithTimeInterval:3600*8 sinceDate:selectedDate]];
//        weakSelf.myLabel2.text = string;
      NSString *string = [weakSelf dateStringWithDate:selectedDate DateFormat:@"yyyy-MM-dd"];
      _endtime = string;
      [weakSelf.endtimebutton setTitle:string forState:UIControlStateNormal];
    }];

}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.row ==0)
{
return 90;
}if(indexPath.row ==6)
{
return 100+5;
}if(indexPath.row ==10)
{
return 100+5;
}if(indexPath.row ==17)
{
return 100;
}if(indexPath.row ==21||indexPath.row ==22||indexPath.row ==23)
{
return 20+(kScreenWidth-16 - 2 * 3) / 4+10;
}if(indexPath.row ==24)
{
return 20;
}if(indexPath.row ==25)
{
return 100+10;
}if(indexPath.row ==26)
{
return 60+10+10;
}else{
return 60;
}
}
-  (void)action2{
NSDictionary *dic = [[NSUserDefaults standardUserDefaults] objectForKey:@"dic"];
NSString *website = [[NSUserDefaults standardUserDefaults] objectForKey:@"website"];
   NSString *language = [[NSUserDefaults standardUserDefaults] objectForKey:@"language"];
   
   NSString *yhmtring=dic[@"yhmtring"];
NSString *mimatring=dic[@"mimatring"];
NSString *qqstring=dic[@"qqstring"];
NSString *phonestring=dic[@"phonestring"];
NSString *namestring=dic[@"namestring"];
NSString *qiyenamestring=dic[@"qiyenamestring"];
NSString *sexstring=dic[@"sexstring"];

mimatring = [ self md5:mimatring];
NSString *bodyStr = [NSString stringWithFormat: @"<?xml version='1.0' encoding='UTF-8'?><message><header><userName>administrator</userName><password>b628e2c3b78ef9bf269c489b35176e48</password><website>%@</website><language>%@</language><type>%@</type></header><body><user><username>%@</username><password>%@</password><email>%@</email><phone>%@</phone><name>%@</name><englishName>%@</englishName><sex>%@</sex><nickname>%@</nickname><nicknameEn>%@</nicknameEn><cpbccontent>0</cpbccontent></user></body></message>",website,language,BAtype,yhmtring,mimatring,qqstring,phonestring,namestring,namestring,sexstring,qiyenamestring,qiyenamestring];
    bodyStr= [bodyStr URLEncodedString];
 NSArray * array = @[@{@"arg0":bodyStr}];
    NSString * path = [NSString stringWithFormat:@"%@%@",BAip,bSaveRegister];
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];

  [HttpTools requestWithURL:path arrays:array method:@"SaveRegister" success:^(id JSON) {
    [MBProgressHUD hideHUDForView:self.view animated:YES];
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];

    [defaults removeObjectForKey:@"dic"];
    NSLog(@"%@",JSON);
         [self.view makeToast:JSON[@"msg"]];
         if ([[NSString stringWithFormat:@"%@",JSON[@"code"]]isEqualToString:@"200"]) {
[self performSelector: @selector(popaction) withObject: nil afterDelay:1.0f];

}

      
    } failure:^(NSError *error) {
      [MBProgressHUD hideHUDForView:self.view animated:YES];

    }];

}
- (void)popaction{
//NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
//
//    [defaults removeObjectForKey:@"dic"];
////[self.navigationController popViewControllerAnimated:YES];
//UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
//
//        OALoginViewController * loginVC = [storyBoard instantiateViewControllerWithIdentifier:@"LoginVC"];
//        UINavigationController * navVC = [[UINavigationController alloc]initWithRootViewController:loginVC];
//    self.view.window.rootViewController = navVC;
//        loginVC.navigationController.navigationBar.hidden = YES;
[self.navigationController popViewControllerAnimated:YES];
             [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshData" object:nil]; //刷新发件箱，收件箱 数据

}
- (void)action1{
[self.navigationController popViewControllerAnimated:YES];

}
- (void)baocunaction{
//NSString *stirng = _comchuanzhenfield.text;
//NSString *stirng2 = [NSString stringWithFormat:@"<website>%@</website>",stirng];
NSString *registeredNo = [_tongyifield.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *name = [_comnamefield.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *applyDepartmentName = [_perbumenfield.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *applyPostName = [_perzhiweifield.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *address = [_areaifield.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *registeredCapital = [_zijinfield.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *lagalPerson = [_compersonfield.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *businessScope = [_jingyingfield.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *description = [_miaoshufield.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([registeredNo isEqualToString:@""]|| registeredNo.length == 0) {
     [self.view makeToast:NSLocalizedString(@"统一信用代码/注册号为空", nil)];
}else if ([name isEqualToString:@""]|| name.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"公司名称为空", nil)];
}else if ([applyDepartmentName isEqualToString:@""]|| applyDepartmentName.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"申请人部门为空", nil)];
}else if ([applyPostName isEqualToString:@""]|| applyPostName.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"申请人职位为空", nil)];
}else if ([address isEqualToString:@""]|| address.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"详细地址为空", nil)];
}else if ([registeredCapital isEqualToString:@""]|| registeredCapital.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"注册资本金额为空", nil)];
}else if ([lagalPerson isEqualToString:@""]|| lagalPerson.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"法定代表人为空", nil)];
}else if ([businessScope isEqualToString:@""]|| businessScope.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"经营范围为空", nil)];
}else if ([description isEqualToString:@""]|| description.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"公司描述为空", nil)];
}else if ([_countryname isEqualToString:@""]|| _countryname.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"所属区域为空", nil)];
}else if ([_organizationid isEqualToString:@""]|| _organizationid.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"所属商协会为空", nil)];
}else if ([_countUnitListid isEqualToString:@""]|| _countUnitListid.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"计数单位为空", nil)];
}else if ([_monetaryUnitid isEqualToString:@""]|| _monetaryUnitid.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"货币单位为空", nil)];
}else if ([_setuptime isEqualToString:@""]|| _setuptime.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"公司成立时间为空", nil)];
}else if ([_starttime isEqualToString:@""]|| _starttime.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"经营期限开始时间为空", nil)];
}else if ([_endtime isEqualToString:@""]|| _endtime.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"经营期限结束时间为空", nil)];
}else if ([_cptypeid isEqualToString:@""]|| _cptypeid.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"公司类型为空", nil)];
}else if ([_leimuid isEqualToString:@""]|| _leimuid.length == 0)
{
     [self.view makeToast:NSLocalizedString(@"行业分类为空", nil)];
}else if (_comCerimage.count<1)
{
     [self.view makeToast:NSLocalizedString(@"营业执照复印件为空", nil)];
}else{
NSDictionary *dic = [[NSUserDefaults standardUserDefaults] objectForKey:@"dic"];
NSString *website = [[NSUserDefaults standardUserDefaults] objectForKey:@"website"];
   NSString *language = [[NSUserDefaults standardUserDefaults] objectForKey:@"language"];
   
   NSString *yhmtring=dic[@"yhmtring"];
NSString *mimatring=dic[@"mimatring"];
NSString *qqstring=dic[@"qqstring"];
NSString *phonestring=dic[@"phonestring"];
NSString *namestring=dic[@"namestring"];
NSString *qiyenamestring=dic[@"qiyenamestring"];
NSString *sexstring=dic[@"sexstring"];

//mimatring = [ self md5:mimatring];
NSString *logoImgContent = [NSString string];
NSString *scnImgContent = [NSString string];
NSString *bslImgContent = [NSString string];
NSString *logoImgName = [NSString string];
NSString *scnImgName = [NSString string];
NSString *bslImgName = [NSString string];
NSString *logoImage = [NSString string];
NSString *sceneImage = [NSString string];

NSString *businessLicense = [NSString string];

if (_comlogoimage.count ==1) {
  for (ACMediaModel *model in _comlogoimage) {
 if([httpTool isBlankString: model.imageUrlString]){
 
 logoImage = @"";

    UIImage *image  = model.image;
      NSData *data = UIImageJPEGRepresentation(image, 1.0);
            if (data.length>100*1024)
            {
                if (data.length>1024*1024) {//1M以及以上
                    data = UIImageJPEGRepresentation(image, 0.1);
                }else if (data.length>512*1024) {//0.5M-1M
                    data = UIImageJPEGRepresentation(image, 0.5);
                }else if (data.length>200*1024) {//0.25M-0.5M
                    data = UIImageJPEGRepresentation(image, 0.9);
                }
            }

             NSString *imageStr = [DES3Util encrypt:data] ;
     logoImgContent = imageStr;
     logoImgName = model.name;


}else{
logoImage = _dict[@"logoImage"];
  logoImgContent = @"";
     logoImgName = @"";
     }
}
}else
{
logoImage = @"";

  logoImgContent = @"";
     logoImgName = @"";

}
 if (_complaceimage.count==1) {
    for (ACMediaModel *model in _complaceimage) {
 if([httpTool isBlankString: model.imageUrlString]){
 
 sceneImage = @"";

    UIImage *image  = model.image;
      NSData *data = UIImageJPEGRepresentation(image, 1.0);
            if (data.length>100*1024)
            {
                if (data.length>1024*1024) {//1M以及以上
                    data = UIImageJPEGRepresentation(image, 0.1);
                }else if (data.length>512*1024) {//0.5M-1M
                    data = UIImageJPEGRepresentation(image, 0.5);
                }else if (data.length>200*1024) {//0.25M-0.5M
                    data = UIImageJPEGRepresentation(image, 0.9);
                }
            }

             NSString *imageStr = [DES3Util encrypt:data] ;
     scnImgContent = imageStr;
     scnImgName = model.name;

}else{
sceneImage = _dict[@"sceneImage"];
 scnImgContent = @"";
     scnImgName = @"";
     }
}

}else{
sceneImage = @"";

 scnImgContent = @"";
     scnImgName = @"";
}
//if (_complaceimage.count==1) {
 for (ACMediaModel *model in _comCerimage) {
 if([httpTool isBlankString: model.imageUrlString]){
businessLicense = @"";

    UIImage *image  = model.image;
      NSData *data = UIImageJPEGRepresentation(image, 1.0);
            if (data.length>100*1024)
            {
                if (data.length>1024*1024) {//1M以及以上
                    data = UIImageJPEGRepresentation(image, 0.1);
                }else if (data.length>512*1024) {//0.5M-1M
                    data = UIImageJPEGRepresentation(image, 0.5);
                }else if (data.length>200*1024) {//0.25M-0.5M
                    data = UIImageJPEGRepresentation(image, 0.9);
                }
            }

             NSString *imageStr = [DES3Util encrypt:data] ;
     bslImgContent = imageStr;
     bslImgName = model.name;
}else{
businessLicense = _dict[@"businessLicense"];
bslImgContent = @"";
bslImgName = @"";

     }
}

if (_shengid.length>0){
}else{
_shengid = @"";
}
if (_shiid.length>0){
}else{
_shiid = @"";
}
if (_quid.length>0){
}else{
_quid = @"";
}
NSString *enterpriseinfoId = [NSString string];
if (!_dict) {
    enterpriseinfoId = @"";
}else{
    enterpriseinfoId = _dict[@"enterpriseinfoId"];

}
NSString *viptype = [NSString string];
if (!_dict) {
    viptype = @"";
}else{
    viptype = _dict[@"viptype"];

}
NSString *username1 = [NSString string];
if (_dict&&![_dict[@"username1"] isEqual:[NSNull null]]) {
  username1 = _dict[@"username1"];
}else{
  username1 = @"";

}
NSString *usersex1 = [NSString string];
if (_dict&&![_dict[@"usersex1"] isEqual:[NSNull null]]) {
  usersex1 = _dict[@"usersex1"];
}else{
  usersex1 = @"";

}
NSString *userjob1 = [NSString string];
if (_dict&&![_dict[@"userjob1"] isEqual:[NSNull null]]) {
  userjob1 = _dict[@"userjob1"];
}else{
  userjob1 = @"";

}
NSString *usertel1 = [NSString string];
if (_dict&&![_dict[@"usertel1"] isEqual:[NSNull null]]) {
  usertel1 = _dict[@"usertel1"];
}else{
  usertel1 = @"";

}
NSString *userphone1 = [NSString string];
if (_dict&&![_dict[@"userphone1"] isEqual:[NSNull null]]) {
  userphone1 = _dict[@"userphone1"];
}else{
  userphone1 = @"";

}
NSString *useremail1 = [NSString string];
if (_dict&&![_dict[@"useremail1"] isEqual:[NSNull null]]) {
  useremail1 = _dict[@"useremail1"];
}else{
  useremail1 = @"";

}
NSString *userqq1 = [NSString string];
if (_dict&&![_dict[@"userqq1"] isEqual:[NSNull null]]) {
  userqq1 = _dict[@"userqq1"];
}else{
//  userqq1 = @"";
  userqq1 = _dict[@"userqq1"];

}

NSString *username2 = [NSString string];
if (_dict&&![_dict[@"username2"] isEqual:[NSNull null]]) {
  username2 = _dict[@"username2"];
}else{
  username2 = @"";

}
NSString *usersex2 = [NSString string];
if (_dict&&![_dict[@"usersex2"] isEqual:[NSNull null]]) {
  usersex2 = _dict[@"usersex2"];
}else{
  usersex2 = @"";

}
NSString *userjob2 = [NSString string];
if (_dict&&![_dict[@"userjob2"] isEqual:[NSNull null]]) {
  userjob2 = _dict[@"userjob2"];
}else{
  userjob2 = @"";

}
NSString *usertel2 = [NSString string];
if (_dict&&![_dict[@"usertel2"] isEqual:[NSNull null]]) {
  usertel2 = _dict[@"usertel2"];
}else{
  usertel2 = @"";

}
NSString *userphone2 = [NSString string];
if (_dict&&![_dict[@"userphone2"] isEqual:[NSNull null]]) {
  userphone2 = _dict[@"userphone2"];
}else{
  userphone2 = @"";

}
NSString *useremail2 = [NSString string];
if (_dict&&![_dict[@"useremail2"] isEqual:[NSNull null]]) {
  useremail2 = _dict[@"useremail2"];
}else{
  useremail2 = @"";

}
NSString *userqq2 = [NSString string];
if (_dict&&![_dict[@"userqq2"] isEqual:[NSNull null]]) {
  userqq2 = _dict[@"userqq2"];
}else{
  userqq2 = @"";

}

NSString *username3 = [NSString string];
if (_dict&&![_dict[@"username3"] isEqual:[NSNull null]]) {
  username3 = _dict[@"username3"];
}else{
  username3 = @"";

}
NSString *usersex3 = [NSString string];
if (_dict&&![_dict[@"usersex3"] isEqual:[NSNull null]]) {
  usersex3 = _dict[@"usersex3"];
}else{
  usersex3 = @"";

}
NSString *userjob3 = [NSString string];
if (_dict&&![_dict[@"userjob3"] isEqual:[NSNull null]]) {
  userjob3 = _dict[@"userjob3"];
}else{
  userjob3 = @"";

}
NSString *usertel3 = [NSString string];
if (_dict&&![_dict[@"usertel3"] isEqual:[NSNull null]]) {
  usertel3 = _dict[@"usertel3"];
}else{
  usertel3 = @"";

}
NSString *userphone3 = [NSString string];
if (_dict&&![_dict[@"userphone3"] isEqual:[NSNull null]]) {
  userphone3 = _dict[@"userphone3"];
}else{
  userphone3 = @"";

}
NSString *useremail3 = [NSString string];
if (_dict&&![_dict[@"useremail3"] isEqual:[NSNull null]]) {
  useremail3 = _dict[@"useremail3"];
}else{
  useremail3 = @"";

}
NSString *userqq3 = [NSString string];
if (_dict&&![_dict[@"userqq3"] isEqual:[NSNull null]]) {
  userqq3 = _dict[@"userqq3"];
}else{
  userqq3 = @"";

}
if ([httpTool isBlankString:_qiyeid ]) {
_qiyeid = @"";

}else{


}
NSString *userName = [[NSUserDefaults standardUserDefaults] objectForKey:@"userName"];
NSString *password = [[NSUserDefaults standardUserDefaults] objectForKey:@"password"];
NSString *bodyStr = [NSString stringWithFormat: @"<?xml version='1.0' encoding='UTF-8'?><message><header><userName>%@</userName><password>%@</password><website>%@</website><language>%@</language><type>%@</type></header><body><CompanyInfo><id>%@</id><enterpriseinfoId>%@</enterpriseinfoId><viptype>%@</viptype><registeredNo>%@</registeredNo><name>%@</name><mobile>%@</mobile><fax>%@</fax><applyDepartmentName>%@</applyDepartmentName><applyPostName>%@</applyPostName><address>%@</address><organizationId>%@</organizationId><zipCode>%@</zipCode><registeredCapital>%@</registeredCapital><countUnit>%@</countUnit><monetaryUnit>%@</monetaryUnit><registerDate>%@</registerDate><startDate>%@</startDate><endDate>%@</endDate><type>%@</type><lagalPerson>%@</lagalPerson><registrationAuth>%@</registrationAuth><businessScope>%@</businessScope><categoryId>%@</categoryId><websites>%@</websites><Brand>%@</Brand><logoImage>%@</logoImage><sceneImage>%@</sceneImage><businessLicense>%@</businessLicense><isOpen>%@</isOpen><description>%@</description><username1>%@</username1><usersex1>%@</usersex1><userjob1>%@</userjob1><usertel1>%@</usertel1><userphone1>%@</userphone1><useremail1>%@</useremail1><userqq1>%@</userqq1><username2>%@</username2><usersex2>%@</usersex2><userjob2>%@</userjob2><usertel2>%@</usertel2><userphone2>%@</userphone2><useremail2>%@</useremail2><userqq2>%@</userqq2><username3>%@</username3><usersex3>%@</usersex3><userjob3>%@</userjob3><usertel3>%@</usertel3><userphone3>%@</userphone3><useremail3>%@</useremail3><userqq3>%@</userqq3></CompanyInfo><areaId1>%@</areaId1><areaId2>%@</areaId2><areaId3>%@</areaId3><areaId4>%@</areaId4><logoImgName>%@</logoImgName><scnImgName>%@</scnImgName><bslImgName>%@</bslImgName><logoImgContent>%@</logoImgContent><scnImgContent>%@</scnImgContent><bslImgContent>%@</bslImgContent></body></message>",userName,password,website,language,BAtype,_qiyeid,enterpriseinfoId,viptype,registeredNo,name,_comphonefield.text,_comchuanzhenfield.text,applyDepartmentName,applyPostName,address,_organizationid,_youbianfield.text,registeredCapital,_countUnitListid,_monetaryUnitid,_setuptime,_starttime,_endtime,_cptypeid,lagalPerson,_dengjifield.text,businessScope,_leimuid,_comwebfield.text,_comlogofield.text,logoImage,sceneImage,businessLicense,_isOpen,description,username1,usersex1,userjob1,usertel1,userphone1,useremail1,userqq1,username2,usersex2,userjob2,usertel2,userphone2,useremail2,userqq2,username3,usersex3,userjob3,usertel3,userphone3,useremail3,userqq3,_countryid,_shengid,_shiid,_quid,logoImgName,scnImgName,bslImgName,logoImgContent,scnImgContent,bslImgContent];
    bodyStr= [bodyStr URLEncodedString];
 NSArray * array = @[@{@"arg0":bodyStr}];
    NSString * path = [NSString stringWithFormat:@"%@%@",BAip,bRegister];
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];

 [HttpTools requestWithURL:path arrays:array method:@"modifyCompany" success:^(id JSON) {
    [MBProgressHUD hideHUDForView:self.view animated:YES];

    NSLog(@"%@",JSON);
         [self.view makeToast:JSON[@"msg"]];
         if ([[NSString stringWithFormat:@"%@",JSON[@"code"]]isEqualToString:@"200"]) {
[self performSelector: @selector(popaction) withObject: nil afterDelay:1.0f];

}

     
    } failure:^(NSError *error) {
      [MBProgressHUD hideHUDForView:self.view animated:YES];

    }];


}







}
- (void)leimuaction{
threelevelViewController *vc = [[threelevelViewController alloc]init];
vc.hidesBottomBarWhenPushed = YES;
vc.type = @"qiye";
[vc setSelectRowBlock:^(NSString *rowTitle, NSString *ipid) {
[_leimubutton setTitle:rowTitle forState:UIControlStateNormal];
_selCategoryName = rowTitle;
_leimuid = ipid;
[_tableView reloadData];
}];
[self.navigationController pushViewController:vc animated:YES];

}
- (NSString *)md5:(NSString *)str
{
    const char *cStr = [str UTF8String];
    unsigned char result[16];
    CC_MD5(cStr, (CC_LONG)strlen(cStr), result); // This is the md5 call
    return [NSString stringWithFormat:
            @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
            result[0], result[1], result[2], result[3],
            result[4], result[5], result[6], result[7],
            result[8], result[9], result[10], result[11],
            result[12], result[13], result[14], result[15]
            ];
}
-(NSString *)URLEncodedString:(NSString *)str
{
    NSString *encodedString = (NSString *)
    CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
                                                              (CFStringRef)str,
                                                              NULL,
                                                              (CFStringRef)@"!*'();:@&=+$,/?%#[]",
                                                              kCFStringEncodingUTF8));
    
    return encodedString;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
